package com.usian.comment.controller.v1;

import com.usian.apis.comment.CommentControllerApi;
import com.usian.comment.service.CommentService;
import com.usian.model.comment.dto.CommentGetDto;
import com.usian.model.comment.dto.CommentLikeDto;
import com.usian.model.comment.dto.CommentSaveDto;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: CommentController
 * Author:   WGG
 * Date:    2022-12-2022/12/6-11:22
 * Version: 1.0
 * Description:
 */
@RestController
@RequestMapping("/comment/api/v1/")
public class CommentController implements CommentControllerApi {

    @Autowired
    private CommentService commentService;


    @Override
    @PostMapping("/saveComment")
    public ResponseResult saveComment(@RequestBody CommentSaveDto dto) {
        return commentService.saveComment(dto);
    }

    @Override
    @PostMapping("/commentLike")
    public ResponseResult commentLike(@RequestBody CommentLikeDto dto) {
        return commentService.commentLike(dto);
    }

    @Override
    @PostMapping("/findApCommentAndOperation")
    public ResponseResult findApCommentAndOperation(@RequestBody CommentGetDto dto) {
        return commentService.findApCommentAndOperation(dto);
    }
}
